package net.pulseproject.commons.midi.entity;

@SuppressWarnings("synthetic-access")
public abstract class DeviceKind {
	
	public static final DeviceKind TRANSMITTER = new DeviceKind("TRANSMITTER") {
		@Override
		public boolean stateIsApplicable(final DeviceState state) {
			return state.isTransmitting();
		}
	};
	
		
	public static final DeviceKind RECEIVER = new DeviceKind("RECEIVER") {
		@Override
		public boolean stateIsApplicable(final DeviceState state) {
			return state.isReceiving();
		}
	};
	
	private final String label;
	
	/**
	 * pseudo-enum, not instantiable from outside
	 */
	private DeviceKind(final String label) {
		this.label = label;
	}
	
	public abstract boolean stateIsApplicable(final DeviceState state);
	
	@Override
	public final String toString() {
		return "DeviceKind." + this.label;
	}
}
